import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 一级装箱分页查询
 * @param {查询条件} data
 */
export function pageProdOnePack(query) {
	return request({
		url: 'ProdManage/ProdOnePack/pageList',
		method: 'get',
		params: query,
	})
}

/**
 * 新增一级装箱
 * @param data
 */
export function addProdOnePack(data) {
	return request({
		url: 'ProdManage/ProdOnePack',
		method: 'post',
		data: data,
	})
}
/**
 * 修改一级装箱
 * @param data
 */
export function updateProdOnePack(data) {
	return request({
		url: 'ProdManage/ProdOnePack',
		method: 'PUT',
		data: data,
	})
}
/**
 * 获取一级装箱详情
 * @param {Id}
 */
export function getProdOnePack(id) {
	return request({
		url: 'ProdManage/ProdOnePack/' + id,
		method: 'get'
	})
}

/**
 * 删除一级装箱
 * @param {主键} pid
 */
export function delProdOnePack(pid) {
	return request({
		url: 'ProdManage/ProdOnePack/delete',
		method: 'POST',
		data: pid
	})
}
// 导出一级装箱
export async function exportProdOnePack(query) {
	await downFile('ProdManage/ProdOnePack/export', { ...query })
}
